<?php

include(dirname(__FILE__).'/../../bootstrap/functional.php');

$browser = new JobeetTestFunctional(new sfBrowser());
$browser->loadData();

$browser->
  clearCookies()->

  get('/category/index')->

  info('5 - Backend category test')->
  info(' 5.1 - check using module')->
  with('request')->begin()->
    isParameter('module', 'category')->
    isParameter('action', 'index')->
  end()->

  info(' 5.2 - check whether admin protected')->
  with('response')->begin()->
    isStatusCode(401)->
    checkElement('body', '!/This is a temporary page/')->
  end()->

  info(' 5.3 - Submit a account with invalid values')->
  click('Signin', array('signin' => array(
    'username' => 'test',
    'password' => 'test',
  )))->

  with('response')->begin()->
    isStatusCode(200)->
    checkElement('body', '!/This is a temporary page/')->
  end()
;
